<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>订单列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/
    bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/bootstrap/css/bootstrap.min.css">
  </head>
  
  
  <body>
     <div id="menu" class="topmenu">
		<%@ include file="../menu.jsp" %>
     </div>
     
    <div class="container">
        <h2 style="color:#ff5800">全部订单</h2>
        <hr>
        
        <ul id="myTab" class="nav nav-tabs" style="color:#ff5800;">
            <li class="active"><a href="#all" data-toggle="tab">
                    全部</a>
            </li>
            <li><a href="#reading" data-toggle="tab">阅读中</a></li>
            <li><a href="#returned" data-toggle="tab">已归还</a></li>
            <li><a href="#needreturn" data-toggle="tab">未归还</a></li>            
        </ul>
        
        <div id="myTabContent" class="tab-content">  
    <!--        全部   -->
            <div id="all" class="tab-pane fade in active">
                <table class="table">
                    <tbody>
                        <s:iterator var="cartItem" value="#session.cart.cartItems">
                           <div class="orderid" style="width:100%;background:#cecece">
                               订单号：1<s:property value="#cartItem.product.bid"/>
                           </div>
                            <tr>
                                <th>图书信息</th>
                                <th>持有人</th>
                                <th>所属分类</th>
                                <th>联系方式</th>
                                <th>归还时间</th>
                            </tr>
                            <tr>
                                <td width="40">
                                    <img src="${pageContext.request.contextPath}/<s:property value="#cartItem.product.image"/>">
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td>
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td class="belong" width="60">
                                    <s:property value="#cartItem.count"/>
                                </td>
                                <td width="140">
                                    <span class="subtotal">￥<s:property value="#cartItem.subtotal"/></span>
                                </td>
                                <td>
                                    <a href="${ pageContext.request.contextPath }/cart_removeCart.action?pid=<s:property value="#cartItem.product.pid"/>" class="delete">删除</a>
                                </td>
                            </tr>
                        </s:iterator>
                    </tbody>
                </table>
            </div>

    <!--        阅读中   -->
            <div id="reading" class="tab-pane fade">
                <table class="table">
                    <tbody>
                        <s:iterator var="cartItem" value="#session.cart.cartItems">
                           <div class="orderid" style="width:100%;background:#cecece">
                               订单号：2<s:property value="#cartItem.product.bid"/>
                           </div>
                            <tr>
                                <th>图书信息</th>
                                <th>持有人</th>
                                <th>所属分类</th>
                                <th>联系方式</th>
                                <th>归还时间</th>
                            </tr>
                            <tr>
                                <td width="40">
                                    <img src="${pageContext.request.contextPath}/<s:property value="#cartItem.product.image"/>">
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td>
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td class="belong" width="60">
                                    <s:property value="#cartItem.count"/>
                                </td>
                                <td width="140">
                                    <span class="subtotal">￥<s:property value="#cartItem.subtotal"/></span>
                                </td>
                                <td>
                                    <a href="${ pageContext.request.contextPath }/cart_removeCart.action?pid=<s:property value="#cartItem.product.pid"/>" class="delete">删除</a>
                                </td>
                            </tr>
                        </s:iterator>
                    </tbody>
                </table>
            </div>


    <!--       已归还   -->
            <div id="returned" class="tab-pane fade">
                <table class="table">
                    <tbody>
                        <s:iterator var="cartItem" value="#session.cart.cartItems">
                           <div class="orderid" style="width:100%;background:#cecece">
                               订单号：3<s:property value="#cartItem.product.bid"/>
                           </div>
                            <tr>
                                <th>图书信息</th>
                                <th>持有人</th>
                                <th>所属分类</th>
                                <th>联系方式</th>
                                <th>归还时间</th>
                            </tr>
                            <tr>
                                <td width="40">
                                    <img src="${pageContext.request.contextPath}/<s:property value="#cartItem.product.image"/>">
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td>
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td class="belong" width="60">
                                    <s:property value="#cartItem.count"/>
                                </td>
                                <td width="140">
                                    <span class="subtotal">￥<s:property value="#cartItem.subtotal"/></span>
                                </td>
                                <td>
                                    <a href="${ pageContext.request.contextPath }/cart_removeCart.action?pid=<s:property value="#cartItem.product.pid"/>" class="delete">删除</a>
                                </td>
                            </tr>
                        </s:iterator>
                    </tbody>
                </table>
            </div>

    <!--       未归还   -->
            <div id="needreturn" class="tab-pane fade">
                <table class="table">
                    <tbody>
                        <s:iterator var="cartItem" value="#session.cart.cartItems">
                           <div class="orderid" style="width:100%;background:#cecece">
                               订单号：4<s:property value="#cartItem.product.bid"/>
                           </div>
                            <tr>
                                <th>图书信息</th>
                                <th>持有人</th>
                                <th>所属分类</th>
                                <th>联系方式</th>
                                <th>归还时间</th>
                            </tr>
                            <tr>
                                <td width="40">
                                    <img src="${pageContext.request.contextPath}/<s:property value="#cartItem.product.image"/>">
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td>
                                    <a target="_blank"><s:property value="#cartItem.product.pname"/></a>
                                </td>
                                <td class="belong" width="60">
                                    <s:property value="#cartItem.count"/>
                                </td>
                                <td width="140">
                                    <span class="subtotal">￥<s:property value="#cartItem.subtotal"/></span>
                                </td>
                                <td>
                                    <a href="${ pageContext.request.contextPath }/cart_removeCart.action?pid=<s:property value="#cartItem.product.pid"/>" class="delete">删除</a>
                                </td>
                            </tr>
                        </s:iterator>
                    </tbody>
                </table>
            </div>
             
        </div> 
    </div>
       
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
	<script src="${pageContext.request.contextPath}/resources/plugins/bootstrap/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/resources/plugins/bootstrap/js/bootstrap.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> 
    <script src="${pageContext.request.contextPath}/js/frontjs/order/orderlist.js"></script>
  </body>
</html>
  